package com.df.handlers;

import com.df.common.*;
import com.df.msgs.Req_Login;
import com.df.msgs.Resp_Login;
import io.netty.channel.Channel;

import java.util.UUID;

public class Req_Login_Handler implements IHandler {
    @Override
    public void handler(Channel channel, IMsg msg) {
        Req_Login req = (Req_Login) msg;

        Resp_Login resp = new Resp_Login();
        String uid = UUID.randomUUID().toString();
        resp.setName(uid);
        Player player = new Player();
        player.setName(uid);
        System.out.println("登录用户:" + player.getName());
        MapThread.getInstance().players.put(uid,player);
    }

    @Override
    public int GetScriptId() {
        return MsgDefine.Req_Login.msgId;
    }

}
